"""从购物车进入 下批采订单v  并取消"""
import allure
from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait

from page.shopping_cart_order_pc_page.shopping_cart_order_pc_dict import get_mall_xpath
from base.WebKeys import WebKeys

class MallFlow_shopping_cart_order_pc(WebKeys):

    def xl_shopping_cart_order(self):
        """购物车进入 去批发下单"""
        with allure.step("点击进货单"):
            self.wait_click(get_mall_xpath('Shopping_cart'))

        with allure.step("批采下单 勾选全部商品"):
            self.is_selected(get_mall_xpath('wholesale_Place_an_order'))

        with allure.step("结算"):
            self.wait_click(get_mall_xpath('Settle_an_account'))

        with allure.step("提交付款"):
            self.wait_click(get_mall_xpath('Submit_payment'))

        with allure.step("确认地址"):
            self.wait_click(get_mall_xpath('Confirm_address'))

        with allure.step("取消订单"):
            self.wait_click(get_mall_xpath('Cancel'))

        with allure.step("取消订单"):
            self.wait_click(get_mall_xpath('Confirm'))


    def get_result_true(self):
        """断言 到收银台界面"""
        result=self.read(get_mall_xpath('Assertion'))
        return result




#
# if __name__ == '__main__':
#
#     m=MallFlow_shopping_cart_order_pc(webdriver.Chrome())
#     m.xl_shopping_cart_order()